//
//  ReversiBoardViewString.h
//  Reversi
//	リバーシボードの表示内容のコントローラー
//
//  Created by 成瀬 龍人 on 2/4/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ReversiBoard.h"
#import "ReversiBoardView.h"

@interface ReversiBoardViewString : NSObject<ReversiBoardView> {
	//	リバーシボードの内容
	NSMutableString* board;
	//	リバーシボードの表示対象
	IBOutlet NSTextField* boardField;
	
	//	x座標の入力オブジェクト
	IBOutlet NSTextField* xPositionField;
	//	y座標の入力オブジェクト
	IBOutlet NSTextField* yPositionField;
	//	putボタン
	IBOutlet NSButton*    putButton;
	id controller;
	IBOutlet NSView* mainView;
	NSMutableArray* willChangePositions;
	ReversiStone willChangeStone;
	bool isPassState;
	
}

//	初期化
- (id)init;

//	リバーシボードモデルオブジェクトで初期化
- (id)initWithBoard:(ReversiBoard*)aBoard
		 controller:(id)controller
		blackPlayer:(NSObject<ReversiPlaying>*)black
		whitePlayer:(NSObject<ReversiPlaying>*)white;

- (void)startPutAnimation:(ReversiStone)stone:(ReversiBoardPosition*)start:(NSArray*)lineArray;
- (BOOL)updatePutAnimation;
- (void)startPassAnimation:(ReversiStone)stone:(NSObject<ReversiPlaying>*)player;
- (BOOL)updatePassAnimation;
- (void)startInvalidPutPosAnimation:(ReversiStone)stone:(NSObject<ReversiPlaying>*)player;
- (BOOL)updateInvalidPutPosAnimation;
- (void)changePlayerTo:(NSObject<ReversiPlaying>*)toPlayer
			   toStone:(ReversiStone)toStone
			fromPlayer:(NSObject<ReversiPlaying>*)fromPlayer
			 fromStone:(ReversiStone)fromStone;
- (void)changeToPassState:(NSObject<ReversiPlaying>*)player:(ReversiStone)stone;
- (NSTimeInterval)timerInterval;
- (NSView*)view;
- (IBAction)put:(id)sender;

//	石を置く
//	既に置いてある場所では上書きされる
//	@param	stone	置く石の種類
//	@param	pos		置く場所
- (void)_put:(ReversiStone)stone pos:(ReversiBoardPosition*)pos;

@end
